package com.example.springbootmybatis.mapper;

import com.example.springbootmybatis.entity.UserTab;
import com.example.springbootmybatis.param.UserParam;
import com.example.springbootmybatis.vo.UserDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper //会被作为持久层操作（数据库）的bean来使用
public interface UserMapper {
    UserTab getUserByid(Integer id);

    List<UserTab> selectAllUser();

    Integer addUser(UserTab user);

    Integer updateUser(UserTab user);

    void del(Integer id);

    Long getUserCount(String userName);

    List<UserTab> getUserByPage(Integer start, Integer pageSize, String userName);

    Long getUserDetailCount(UserParam userParam);

    List<UserDetail> getUserDetailByPage(UserParam userParam);

    UserTab login(UserTab user);
}
